import { get, post, del } from "../utils/request";
//获取购物车数据
export const loadCartsAPI = () => get("/api/v1/shop_carts");

/*加入购物车
product：商品ID
amount：商品数量
price：商品价格
*/
export const addToCartAPI = (product, amount, price) =>
  post("/api/v1/shop_carts", { product, amount, price });

/*
  根据id删除购物车中的数据
  id：购物车id
  
  */
export const delFromCartAPI = (id) => del("/api/v1/shop_carts/" + id);
